Skip to main content

Get Media By File Name

AutomatR.WhatsApp.Activities.GetMediaByFileName

The "Get Media By File Name" activity in AutomatR is part of the WhatsApp activities package, allowing users to retrieve media files from a specified WhatsApp number based on the provided file name. This activity simplifies the process of fetching media content, enhancing automation capabilities for WhatsApp-related workflows.

Properties

NameDescription
Input
File NameSpecifies the file name format with the full path. For example: data/images/c1d465a1-3cbf-4190-a936-1c2ddd63f057.jpg (String). Required argument.
File PathProvides the full path to save the retrieved file. For example: D:/sample.jpg (String). Required argument.
OverwriteWhen selected, overwrites existing files in the destination folder with the retrieved file. Boolean variable.
Misc
Display NameProvides a customizable name for the activity displayed in the workflow. String variables containing the desired display name.
Optional
DelaySpecifies the amount of time (in seconds) to wait before executing the "Get Media By File Name" activity. This can be useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the amount of time is 1000 milliseconds or 1 sec, i.e., 1.

How to use:

  1. Drag and drop the "Get Media By File Name" activity onto the workflow.
  2. Configure the properties by specifying the file name with the full path, the destination file path, and optionally, whether to overwrite existing files.
  3. Optionally, configure the delay and customize the display name.
  4. Execute the workflow to retrieve the specified media file from WhatsApp and save it to the provided destination path.

Example: Consider an example where the "Get Media By File Name" activity is used to retrieve an image file named "sample.jpg" from a WhatsApp number and save it to the "D:/" directory:

Get Media By File Name:
Display Name: "Retrieve Sample Image"
File Name: "data/images/sample.jpg"
File Path: "D:/sample.jpg"
Overwrite: true

In this example, the activity retrieves the image file named "sample.jpg" from the specified WhatsApp number, and if the file already exists at "D:/sample.jpg," it overwrites the existing file.